<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>数组求和</title>
		<script>
		function sum(arr){
			var sum=0;
			for(var i=0;i<arr.length;i++){
				sum=arr[i]+sum;
			}
			return sum
		}
		console.log(sum([1,2,3,4,5,6,8,9,7]))</script>
	</head>
	<body><h1>数组求和</h1>
	</body>
</html>
